package com.pac.weixin.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.pac.location.bean.LocationBean;
import com.pac.location.service.LocationService;

/**
 * 微信端区域处理
 * 
 * @author lujun.chen
 * @version [版本号, 2015年3月1日]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Controller
@Scope("prototype")
@RequestMapping("/weixin/location")
public class WxLocationController {
	
	@Autowired
	private LocationService locationService;
	
	/**
	 * 根据父级ID查询下级区域信息
	 * 
	 * @param parentId
	 *            上级区域ID
	 * @return
	 * @see [类、类#方法、类#成员]
	 */
	@RequestMapping("/grade/next")
	@ResponseBody
	public List<LocationBean> queryNextGradeLocation(String parentId) {

		return locationService.queryLocationByParentId(parentId);
	}

}
